﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Collections;

namespace E.Y.E.Jobs
{
    class MasterControl
    {
        private const string TaskManagerFile = "TaskList.txt";
        private const string CommandTypeFile = "TypeList.txt";

        CommandStandardiser Standardiser;
        TaskManager TaskList;
        CommandTypeManager TypeList;
        History ActionHistory;

        public MasterControl()
        {
            TaskList = new TaskManager(TaskManagerFile);
            TypeList = new CommandTypeManager(CommandTypeFile);
            Standardiser = new CommandStandardiser();
            ActionHistory = new History();
        }

        InformationPackage ProcessCommand(string UserCommand)
        {
            InformationPackage Result;

            ICommand StandardCommand = Standardiser.StandardiseCommand(ref TypeList, UserCommand);

            StandardCommand.Execute(ref TaskList, ref TypeList, ref ActionHistory);

            Result = StandardCommand.ConvertToInfoPackage();

            return Result;
        }
    }
}
